import webpackMerge from "webpack-merge";
import commonConfig from "./webpack.common";
import FriendlyErrorsWebpackPlugin from "friendly-errors-webpack-plugin";
import chalk from "chalk";
import { HOST, PORT } from "../env";

export default webpackMerge(commonConfig, {
  mode: "development",
  plugins: [
    new FriendlyErrorsWebpackPlugin({
      clearConsole: true,
      compilationSuccessInfo: {
        messages: [
          `Dev server is running at:`,
          `\t ${chalk.green(chalk.underline(`http://${HOST}:${PORT}`))}`,
        ],
        notes: [],
      },
    }),
  ],
});
